const state = {
  index: 0 /* 菜单栏索引 */,
  hasScene: false /* 当前是否有场景 */,
}

const getters = {
  // 查询当前选中的菜单项索引
  queryCurrentIndex: state => state.index,
  // 查询当前是否有场景
  queryHasScene: state => state.hasScene
}

// 同步数据
const mutations = {
  setCurrentIndex(state, data) {
    state.index = data
  },

  sureHasScene(state, data) {
    state.hasScene = data
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  getters
}